﻿
using System;
using System.Diagnostics;
namespace Mbs
{
    /// <summary>
    /// 监听器接口
    /// </summary>
    /// <remarks>充当观察者模式中的抽象观察者角色</remarks>
    public interface IListner
    {

    }

    public interface IListner<TEnum>
    {
        TEnum Type { get; }
    }

    [Serializable]
    public class Listner : MarshalByRefObject, IListner
    {
        public override object InitializeLifetimeService()
        {
            return null;
        }
    }

    [Serializable]
    public class Listner<TEnum> : Listner
    {
        public TEnum Type { get; private set; }

        protected Listner(TEnum type)
        {
            Trace.Assert(type != null, "type == null");
            //Trace.Assert(Enum.IsDefined(type.GetType(), type), "type does not Enum type");
            Type = type;
        }
    }
}
